<include file="Public/min-header" />
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <style type="text/css">
        .navbar{margin-bottom: 0px;}
    </style>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <nav class="navbar navbar-default">
                            <div class="collapse navbar-collapse">
                                <form class="navbar-form form-inline" action="{:U('Store/store_list_yijia_quyu')}" method="get">
                                    <div class="form-group">
                                        <input type="text" name="store_name" class="form-control" value="{:I('store_name')}" placeholder="请输店铺名称">
                                    </div>
                                    <button type="submit" class="btn btn-primary">查询</button>
                                </form>
                            </div>
                        </nav>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="list-table" class="table table-bordered table-striped dataTable">
                                    <thead>
                                    <tr role="row">
                                        <th>ID</th>
                                        <th>店铺logo</th>
                                        <th>店铺名称</th>
                                        <th>卖家账号</th>
                                        <th>所属会员</th>
                                        <th>进驻日期</th>
                                        <th>状态</th>
                                        <th style="text-align: center;">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="list" item="vo" key="k" >
                                        <tr role="row">
                                            <td>{$vo.store_id}</td>
                                            <td><img width="50" height="50" src="{$vo.store_logo}"/></td>
                                            <td>{$vo.store_name}</td>
                                            <td>{$vo.nickname}</td>
                                            <td>{$vo.seller_name}</td>
                                            <td>{$vo.store_time|date='Y-m-d',###}</td>
                                            <td><?php
							 if($vo['yijia_quyu'] == ''){
								 echo '<span style="color:green">无限制</span>';
                                                }else{
                                                echo '<span style="color:red">有限制</span>';
                                                }
                                                ?></td>
                                            <td class="text-center">
                                                <a class="btn btn-info" href="JavaScript:" id="bianji" rel="{$vo.store_id}" rev="bianji">编辑溢价区域</a>
                                                <a class="btn btn-danger" id="bianji" rel="{$vo.store_id}" rev="del">清除溢价区域</a>
                                            </td>
                                        </tr>
                                    </foreach>
                                    </tbody>
                                    <tfoot>

                                    </tfoot>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left">
                                <button class="btn btn-default btn-sm checkbox-toggle"><i class="fa fa-square-o"></i></button>
                            </div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <script type="text/javascript">
        $(document).ready(function() {
            $(".box-body #bianji").click(function(){
                var myrel=$(this).attr('rel'),myrev=$(this).attr('rev'),obj=$(this).parent().parent();
                if(myrev=="bianji"){
                    var myrul='/Admin/Store/store_bianji_yijia_quyu/store_id/'+myrel;//+myrel;
                    layer.open({
                        type: 2,
                        title:'编辑区域价格',
                        shadeClose: true, //点击遮罩关闭
                        skin: 'layui-layer-rim', //加上边框
                        area: ['920px', '620px'], //宽高
                        content: myrul
                    })
                }else{
                    $.post('/Admin/Store/store_bianji_yijia_quyu',{action:'alldel',store_id:myrel},function(res){
                        layer.msg('清除限制成功！',{icon:6});
                        obj.remove();
                    })
                }

            });
        });
    </script>
</div>
</body>
</html>
